import 'package:practice/data/entity/organ_entity.dart';

organEntityFromJson(OrganEntity data, Map<String, dynamic> json) {
	if (json['institutionId'] != null) {
		data.institutionId = json['institutionId'].toString();
	}
	if (json['institutionName'] != null) {
		data.institutionName = json['institutionName'].toString();
	}
	if (json['privateKey'] != null) {
		data.privateKey = json['privateKey'].toString();
	}
	if (json['courseAuth'] != null) {
		data.courseAuth = json['courseAuth'] is String
				? int.tryParse(json['courseAuth'])
				: json['courseAuth'].toInt();
	}
	return data;
}

Map<String, dynamic> organEntityToJson(OrganEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['institutionId'] = entity.institutionId;
	data['institutionName'] = entity.institutionName;
	data['privateKey'] = entity.privateKey;
	data['courseAuth'] = entity.courseAuth;
	return data;
}